package com.dreem.principle.liskov;

/**
 * @program: DesignParrtern
 * @description:
 * @author: Peng
 * @create: 2021-01-16  11:33
 **/
public class Liskov01 {
    public static void main(String[] args){
        System.out.println("11 - 8 = " + new A().func1(11, 8));
        System.out.println("1 - 8 = " + new A().func1(1, 8));
        System.out.println("11 - 8 + 9 = " + new B().func2(11, 8, 9));
    }
}

class A{
    public int func1(int num1, int num2){
        return num1 - num2;
    }
}

class B extends A {
    public int func1(int a, int b){
        return a + b;
    }
    public int func2(int a, int b, int c){
        return func1(a, b) + c;
    }
}